﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
	public class UserInfoConfig : IEntityTypeConfiguration<UserInfo>
	{
		public void Configure(EntityTypeBuilder<UserInfo> builder)
		{
			builder.ToTable("T_User");
			builder.Property(u => u.UserName).HasMaxLength(20).IsRequired();
			builder.Property(u => u.Password).HasMaxLength(20).IsRequired();
			builder.Property(u => u.FullName).HasMaxLength(20).IsRequired();
			builder.Property(u => u.Phone).HasMaxLength(13).IsRequired();
			builder.Property(u => u.DelFlag).HasMaxLength(1).HasDefaultValue(0);
			builder.Property(u => u.Role).HasMaxLength(1).IsRequired();


		}
	}
}
